package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.time.LocalDate;
import java.util.List;

/**
 * 主贴实体类
 */
@TableName("t_stick")
public class StickBean {
    /**主贴编号*/
    @TableId(value = "pk_stickId",type = IdType.AUTO)
    private Integer stickId;
    /**标题*/
    @TableField("s_stickTitle")
    private String stickTitle;
    /**主贴内容*/
    @TableField("s_stickContent")
    private String stickContent;
    /**发帖人id*/
    @TableField("fk_userId")
    private Integer userId;
    /**发帖人*/
    @TableField(exist = false)
    private UserBean user;
    /**回帖对象集合*/
    @TableField(exist = false)
    private List<ReplyBean> replyList;
    /**回帖数量*/
    @TableField(exist = false)
    private Integer replyNum;
    /**频道id*/
    @TableField("fk_channelId")
    private Integer channelId;
    /**频道对象*/
    @TableField(exist = false)
    private ChannelBean channelBean;
    /**发帖时间*/
    @TableField("s_postDate")
    private LocalDate postDate = LocalDate.now();

    public StickBean() {
    }

    public StickBean(String stickTitle, String stickContent, Integer userId, Integer channelId) {
        this.stickTitle = stickTitle;
        this.stickContent = stickContent;
        this.userId = userId;
        this.channelId = channelId;
    }

    public Integer getStickId() {
        return stickId;
    }

    public void setStickId(Integer stickId) {
        this.stickId = stickId;
    }

    public String getStickTitle() {
        return stickTitle;
    }

    public void setStickTitle(String stickTitle) {
        this.stickTitle = stickTitle;
    }

    public String getStickContent() {
        return stickContent;
    }

    public void setStickContent(String stickContent) {
        this.stickContent = stickContent;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public UserBean getUser() {
        return user;
    }

    public void setUser(UserBean user) {
        this.user = user;
    }

    public List<ReplyBean> getReplyList() {
        return replyList;
    }

    public void setReplyList(List<ReplyBean> replyList) {
        this.replyList = replyList;
    }

    public Integer getReplyNum() {
        return replyNum;
    }

    public void setReplyNum(Integer replyNum) {
        this.replyNum = replyNum;
    }

    public Integer getChannelId() {
        return channelId;
    }

    public void setChannelId(Integer channelId) {
        this.channelId = channelId;
    }

    public ChannelBean getChannelBean() {
        return channelBean;
    }

    public void setChannelBean(ChannelBean channelBean) {
        this.channelBean = channelBean;
    }

    public LocalDate getPostDate() {
        return postDate;
    }

    public void setPostDate(LocalDate postDate) {
        this.postDate = postDate;
    }

    @Override
    public String toString() {
        return "StickBean{" +
                "stickId=" + stickId +
                ", stickTitle='" + stickTitle + '\'' +
                ", stickContent='" + stickContent + '\'' +
                ", userId=" + userId +
                ", user=" + user +
                ", replyList=" + replyList +
                ", replyNum=" + replyNum +
                ", channelId=" + channelId +
                ", channelBean=" + channelBean +
                ", postDate=" + postDate +
                "}\n";
    }
}
